{% extends "system/books_admin_base.html" %}
{% load static %}
{% load bootstrap3 %}




<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="/static/ico/book-admin.png">

    <title>Starter Template for Bootstrap</title>

    <!-- Bootstrap core CSS -->
    <link href="/static/css/bootstrap.min.css" rel="stylesheet">

    <!-- Custom styles for this template -->
    <link href="/static/css/start-template/start-template.css" rel="stylesheet">
  </head>

  <body>

    {% block starter-template %}
    <!-- 删掉base模板所带的标题 -->
    {% endblock %}

    {% block row %}
        {% if book_info %}
            <div class="col-md-12">
                <h4 class="mb-3">图书信息</h4>
                <form method="post" class="needs-validation" novalidate="">
                    {% csrf_token %}
                <div class="row">
                    <div class="col-md-12 mb-3">
                        <label for="book_name">书名</label>
                        <input type="text" class="form-control" name="book_name" id="book_name" placeholder="{{ book_info.book_name }}" value="{{ book_info.book_name }}" required="">
                    </div>
                    <!-- 验证输入框有无值 -->
                    <div class="invalid-feedback">
                        请输入图书名称
                    </div>
                </div>

                <div class="mb-3">
                    <label for="book_author">作者</label>
                    <div class="input-group">
                        <input type="text" class="form-control" name="book_author" id="book_author" placeholder="{{ book_info.book_author }}" value="{{ book_info.book_author }}" required="">
                        <div class="invalid-feedback" style="width: 100%;">
                            请输入图书作者的名字
                        </div>
                    </div>
                </div>

                <div class="mb-3">
                    <label for="book_publish">出版社<span class="text-muted"></span></label>
                    <input type="text" class="form-control" name="book_publish" id="book_publish" placeholder="{{ book_info.book_publish }}" value="{{ book_info.book_publish }}" required="">
                    <div class="invalid-feedback">
                        请输入图书的出版社
                    </div>
                </div>

                <div class="mb-3">
                    <label for="book_language">语言</label>
                    <input type="text" class="form-control" name="book_language" id="book_language" placeholder="{{ book_info.book_language }}" value="{{ book_info.book_language }}" required="">
                    <div class="invalid-feedback">
                        请输入图书的语言
                    </div>
                </div>

                <div class="mb-3">
                    <label for="book_price">价格<span class="text-muted"></span></label>
                    <input type="text" class="form-control" name="book_price" id="book_price" placeholder="{{ book_info.book_price }}" value="{{ book_info.book_price }}" required="">
                    <div class="invalid-feedback">
                        请输入图书的价格
                    </div>
                </div>

                <div class="mb-3">
                    <label for="book_publish_date">出版日期<span class="text-muted"><small>    请输入格式如: 2018/01/01 <br>原出版日期: {{ book_info.book_publish_date }}</small></span></label>
                    <input type="text" class="form-control" name="book_publish_date" id="book_publish_date" placeholder="" value="" required="">
                    <div class="invalid-feedback">
                        请输入图书的出版日期
                    </div>
                </div>

                <div class="mb-3">
                    <label for="book_ISBN">ISBN<span class="text-muted"></span></label>
                    <input type="text" class="form-control" name="book_ISBN" id="book_ISBN" placeholder="{{ book_info.book_ISBN }}" value="{{ book_info.book_ISBN }}" required="">
                    <div class="invalid-feedback">
                        请输入图书的ISBN码
                    </div>
                </div>

                <div class="mb-3">
                    <label for="book_introduction">简介<span class="text-muted"></span></label>
                    <textarea class="form-control" name="book_introduction" id="" cols="30" rows="6"> {{ book_info.book_introduction }} </textarea>
                    <div class="invalid-feedback">
                        请输入图书的简介
                    </div>
                </div>

                <hr class="mb-4">
                <button class="btn btn-primary btn-lg btn-block" type="submit">Confirm</button>
                    <br>
                </form>
            </div>
        {% endif %}
    {% endblock %}


  </body>
</html>